package com.example.paper.mvp.model;

import com.example.mvp.model.BaseEntity;
import com.example.mvp.model.BaseModel;

import com.example.paper.api.Api;
import com.example.paper.brean.ResultBean;
import com.example.paper.http.factory.ChangeFunction;
import com.example.paper.http.factory.HttpFactory;
import com.example.paper.http.factory.HttpType;
import com.example.paper.mvp.contract.AllContract;

import java.util.Map;

import io.reactivex.Observable;

public class AllModel extends BaseModel implements AllContract.AllModel {

    @Override
    public Observable<BaseEntity> getTokent(Map<String, Object> map) {
        Observable<ResultBean> ob = HttpFactory.getInstance().factory(HttpType.SIGNTYPE)
                .getRetrofit()
                .create(Api.class)
                .requestToken(createBody(map));

        return ob.map(new ChangeFunction<ResultBean>());
    }

}
